package com.qdxht.dispenser.http.model;

import org.json.JSONObject;

public class MqttControlCommand {
    public String operation;
    public String uuid;
    public JSONObject content;

    public static MqttControlCommand fromJson(String jsonStr) {
        try {
            JSONObject obj = new JSONObject(jsonStr);
            MqttControlCommand cmd = new MqttControlCommand();
            cmd.operation = obj.optString("operation");
            cmd.uuid = obj.optString("uuid");
            cmd.content = obj.optJSONObject("content");
            return cmd;
        } catch (Exception e) {
            return null;
        }
    }
} 